package com.foreknow.test;

/**
 * 动态可变参数
 */
public class DyVarParameter {
    public void method1(int a,int b) {
        System.out.println(a+b);
    }

    //Object...values相当于一个Object[]
    //sql: select * from admin
    public void method2(String sql,Object...values){
        System.out.println(sql);
    }

    public static void main(String[] args) {
        DyVarParameter dyVarParameter = new DyVarParameter();
        dyVarParameter.method1(1,2);
        dyVarParameter.method2("select * from admin where username=? and password=?","tom","123456");
    }
}
